-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor UpdatePcfSubsriberPolicyData to cover all existing IMSI #125
Refactor UpdatePcfSubsriberPolicyData to cover all existing IMSI #125
Conversation
… device group Signed-off-by: gatici <gulsum.atici@canonical.com>
Working on unit tests. |
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
service/init.go
Outdated
policyData.PccPolicy[sliceid].TraffContDecs[index] = element | ||
} | ||
policyData.CtxLog.Infof("Subscriber Detals: %v", policyData) | ||
pcf.CreatePolicyDataforImsi(imsi, sliceid, dnn, sessionrule, slice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understand the solution. calling same function 2 times? How it solves the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change, pcf subscriber policy data is updated only for the IMSI's which are under slice.AddUpdatedImsis upon slice updates. However, the policy could be changed for the IMSI's under slice.DeviceGroup which is not under slice.AddUpdatedImsis. Hence, pcf subscriber policy data update is partially done (for some IMSI's). This was the reason of issue. If we regenerate the subscriber policy for all the IMSI's under devicegroup, the issue is fixed.
By the way, I removed the loop for slice.AddUpdatedImsis in the latest patch as this part is already covered in the first loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to ask you so many questions. But could you please help me with what imsi's under slice and device group. My understanding tells me that imsi's under slice is superset of imsi's under device group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network slice includes DeviceGroup, AddUpdatedIMSIs and DeletedIMSIs as below:
type NetworkSlice struct {
DeviceGroup []*DeviceGroup `protobuf:"bytes,4,rep,name=DeviceGroup,proto3" json:"DeviceGroup,omitempty"`
AddUpdatedImsis []string `protobuf:"bytes,11,rep,name=AddUpdatedImsis,proto3" json:"AddUpdatedImsis,omitempty"` //metadata is set in request then send 11,12 in response
DeletedImsis []string `protobuf:"bytes,12,rep,name=DeletedImsis,proto3" json:"DeletedImsis,omitempty"`
...
}
type DeviceGroup struct {
Imsi []string `protobuf:"bytes,3,rep,name=Imsi,proto3" json:"Imsi,omitempty"`
...
}
DeviceGroup.IMSI keeps the available (active) IMSIs for this slice.
AddUpdatedIMSIs keeps the IMSIs to be added to the slice.DeviceGroup // What I found, Adding IMSIs to the slice is still in TODO in AMF. Please see:
https://github.com/omec-project/amf/blob/master/service/init.go#L657
DeletedIMSIs keeps the IMSIs to be deleted from the slice.DeviceGroup
From the PCF perspective, PCF needs to produce policies for active IMSIs. Besides, unnecessary policies needs to be removed upon slice changes. Hence, polices are produced by UpdatePcfSubsriberPolicyData method for all IMSIs under device group upon SLICE_ADD. Polices are produced for the device group IMSIs which are not in the DeletedIMSIs upon SLICE_UPDATEs.
As a summary, AddUpdatedIMSIs and DeletedIMSIs indicates the changes and taken into consideration while creating policies for active IMSIs.
2024-07-09T10:34:54+03:00 [INFO][PCF][GRPC] Slice.DeviceGroup: [Name:"dg1" IpDomainDetails:{DnnName:"internet" UeDnnQos:{DnnMbrUplink:20000 DnnMbrDownlink:80000 TrafficClass:{Qci:9 Arp:6}}} Imsi:"123456789123456" Imsi:"123456789123457" Imsi:"123456789123458" Imsi:"123456789123459" Imsi:"123456789123460"]
2024-07-09T10:34:54+03:00 [INFO][PCF][GRPC] devgroup.Imsi: [123456789123456 123456789123457 123456789123458 123456789123459 123456789123460]
Signed-off-by: gatici <gulsum.atici@canonical.com>
Signed-off-by: gatici <gulsum.atici@canonical.com>
This is tested manually and worked well. |
Refactor UpdatePcfSubsriberPolicyData to cover all existing IMSI's in device group.
Fixes omec-project/smf#228.
UpdatePcfSubsriberPolicyData method was not updating policy data for the IMSI's under device groups. This change allows to update policy for IMSIs under device group.